package org.cuadroanotacionapi.persistencia;

import org.cuadroanotacionapi.beans.Jos_fastball_team;
import java.sql.Time;
import org.cuadroanotacionapi.beans.*;
import org.cuadroanotacionapi.controller.*;
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
import java.util.*;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.util.Map;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Map;
 import javax.sql.DataSource;
import org.cuadroanotacionapi.generales.Mensajeria;
import org.cuadroanotacionapi.generales.Sesion;


/**
*
* @author
*/

public class Jos_fastball_teamPersistencia implements Serializable {
private static final long serialVersionUID = 1L;
public static Exception excepcion;
public static boolean esMensaje = false;
public static Connection con = null;

public Jos_fastball_teamPersistencia(){
         esMensaje =false;
}


/**
*
* Insertar()
*/

public static boolean Insertar (Jos_fastball_team jos_fastball_team ) {
  excepcion = null;
  try {
      esMensaje =false;
   
   
   
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pinsert = null;
      String sql = "insert into jos_fastball_team(id,leagueid,divisionid,defaultteam,name,shortname,city,state,adminids,mname,mphone,mmobile,memail,mshow,m1name,m1phone,m1mobile,m1email,m1show,m2name,m2phone,m2mobile,m2email,logo,photo,accomplishments,checked_out,checked_out_time,published)  values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
      pinsert = con.prepareStatement(sql);
              pinsert.setInt(1,jos_fastball_team.getId());
        pinsert.setInt(2,jos_fastball_team.getLeagueid());
        pinsert.setInt(3,jos_fastball_team.getDivisionid());
        pinsert.setBoolean(4,jos_fastball_team.getDefaultteam());
        pinsert.setString(5,jos_fastball_team.getName());
        pinsert.setString(6,jos_fastball_team.getShortname());
        pinsert.setString(7,jos_fastball_team.getCity());
        pinsert.setString(8,jos_fastball_team.getState());
        pinsert.setString(9,jos_fastball_team.getAdminids());
        pinsert.setString(10,jos_fastball_team.getMname());
        pinsert.setString(11,jos_fastball_team.getMphone());
        pinsert.setString(12,jos_fastball_team.getMmobile());
        pinsert.setString(13,jos_fastball_team.getMemail());
        pinsert.setBoolean(14,jos_fastball_team.getMshow());
        pinsert.setString(15,jos_fastball_team.getM1name());
        pinsert.setString(16,jos_fastball_team.getM1phone());
        pinsert.setString(17,jos_fastball_team.getM1mobile());
        pinsert.setString(18,jos_fastball_team.getM1email());
        pinsert.setBoolean(19,jos_fastball_team.getM1show());
        pinsert.setString(20,jos_fastball_team.getM2name());
        pinsert.setString(21,jos_fastball_team.getM2phone());
        pinsert.setString(22,jos_fastball_team.getM2mobile());
        pinsert.setString(23,jos_fastball_team.getM2email());
        pinsert.setString(24,jos_fastball_team.getLogo());
        pinsert.setString(25,jos_fastball_team.getPhoto());
        pinsert.setString(26,jos_fastball_team.getAccomplishments());
        pinsert.setBoolean(27,jos_fastball_team.getChecked_out());
        pinsert.setTime(28,jos_fastball_team.getChecked_out_time());
        pinsert.setBoolean(29,jos_fastball_team.getPublished());
      int filas= pinsert.executeUpdate();
      pinsert.close();
      con.close();
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
 }


/**
*
* Editar()
*/

public static boolean Editar(Jos_fastball_team jos_fastball_team ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update jos_fastball_team set  id=?, leagueid=?, divisionid=?, defaultteam=?, name=?, shortname=?, city=?, state=?, adminids=?, mname=?, mphone=?, mmobile=?, memail=?, mshow=?, m1name=?, m1phone=?, m1mobile=?, m1email=?, m1show=?, m2name=?, m2phone=?, m2mobile=?, m2email=?, logo=?, photo=?, accomplishments=?, checked_out=?, checked_out_time=?, published=?  where  id ='"+jos_fastball_team.getId()+"'  ";
      pupdate= con.prepareStatement(sql);
      pupdate.setInt(1,jos_fastball_team.getId());
pupdate.setInt(2,jos_fastball_team.getLeagueid());
pupdate.setInt(3,jos_fastball_team.getDivisionid());
pupdate.setBoolean(4,jos_fastball_team.getDefaultteam());
pupdate.setString(5,jos_fastball_team.getName());
pupdate.setString(6,jos_fastball_team.getShortname());
pupdate.setString(7,jos_fastball_team.getCity());
pupdate.setString(8,jos_fastball_team.getState());
pupdate.setString(9,jos_fastball_team.getAdminids());
pupdate.setString(10,jos_fastball_team.getMname());
pupdate.setString(11,jos_fastball_team.getMphone());
pupdate.setString(12,jos_fastball_team.getMmobile());
pupdate.setString(13,jos_fastball_team.getMemail());
pupdate.setBoolean(14,jos_fastball_team.getMshow());
pupdate.setString(15,jos_fastball_team.getM1name());
pupdate.setString(16,jos_fastball_team.getM1phone());
pupdate.setString(17,jos_fastball_team.getM1mobile());
pupdate.setString(18,jos_fastball_team.getM1email());
pupdate.setBoolean(19,jos_fastball_team.getM1show());
pupdate.setString(20,jos_fastball_team.getM2name());
pupdate.setString(21,jos_fastball_team.getM2phone());
pupdate.setString(22,jos_fastball_team.getM2mobile());
pupdate.setString(23,jos_fastball_team.getM2email());
pupdate.setString(24,jos_fastball_team.getLogo());
pupdate.setString(25,jos_fastball_team.getPhoto());
pupdate.setString(26,jos_fastball_team.getAccomplishments());
pupdate.setBoolean(27,jos_fastball_team.getChecked_out());
pupdate.setTime(28,jos_fastball_team.getChecked_out_time());
pupdate.setBoolean(29,jos_fastball_team.getPublished());
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo actualizar");
          esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* Editar()
*/

public static boolean Editar(String sqlupdate ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update  jos_fastball_team set " + sqlupdate +"";
      pupdate= con.prepareStatement(sql);
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo editar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* EditarClavePrimaria()
*/

public static boolean EditarClavePrimaria(Jos_fastball_team jos_fastball_team_old , Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pupdate = null;
      String sql = "update jos_fastball_team set  id=?  where  id ='"+jos_fastball_team_old.getId()+"'  ";
      pupdate= con.prepareStatement(sql);
      pupdate.setInt(1,jos_fastball_team.getId());
      int filas= pupdate.executeUpdate();
      pupdate.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo actualizar");
          esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* Eliminar()
*/

public static boolean Eliminar(Jos_fastball_team jos_fastball_team ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_team  where  id = ?  ";
      pdelete= con.prepareStatement(sql);
      pdelete.setInt(1,jos_fastball_team.getId());
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* EliminarSQL()
*/

public static boolean Eliminar(String sqldelete ) {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_team where " + sqldelete +"";
      pdelete= con.prepareStatement(sql);
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* ElimninarTodos()
*/

public static boolean EliminarTodos() {
  excepcion = null;
  try {
      esMensaje =false;
     if (!Conectar()) {
         return false;
      }
      PreparedStatement pdelete = null;
      String sql = "delete from jos_fastball_team  ";
      pdelete= con.prepareStatement(sql);
      int filas= pdelete.executeUpdate();
      pdelete.close();
      con.close();
      if (filas <= 0){
          excepcion = new Exception("No se pudo eliminar todos los registros");
           esMensaje =true;
          return false;
      }
      return true;
   } catch (Exception e) {
      excepcion = e;
   } finally {
  }
  return false;
}


/**
*
* ExisteRegistro()
*/



public static boolean ExisteRegistro(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return false;
      }
      String sql = "select * from jos_fastball_team where id='"+jos_fastball_team.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return false;
   }
    rs.close();
    psquery.close();
    con.close();
 return true;
} catch (Exception ex) {
      excepcion = ex;
}
  return false;
}


/**
*
* findByPrimaryKey()
*/



public static Jos_fastball_team findByPrimaryKey(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      String sql = "select * from jos_fastball_team where id='"+jos_fastball_team.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
            
            
            jos_fastball_team.setId(rs.getInt("id"));
jos_fastball_team.setLeagueid(rs.getInt("leagueid"));
jos_fastball_team.setDivisionid(rs.getInt("divisionid"));
jos_fastball_team.setDefaultteam(rs.getBoolean("defaultteam"));
jos_fastball_team.setName(rs.getString("name"));
jos_fastball_team.setShortname(rs.getString("shortname"));
jos_fastball_team.setCity(rs.getString("city"));
jos_fastball_team.setState(rs.getString("state"));
jos_fastball_team.setAdminids(rs.getString("adminids"));
jos_fastball_team.setMname(rs.getString("mname"));
jos_fastball_team.setMphone(rs.getString("mphone"));
jos_fastball_team.setMmobile(rs.getString("mmobile"));
jos_fastball_team.setMemail(rs.getString("memail"));
jos_fastball_team.setMshow(rs.getBoolean("mshow"));
jos_fastball_team.setM1name(rs.getString("m1name"));
jos_fastball_team.setM1phone(rs.getString("m1phone"));
jos_fastball_team.setM1mobile(rs.getString("m1mobile"));
jos_fastball_team.setM1email(rs.getString("m1email"));
jos_fastball_team.setM1show(rs.getBoolean("m1show"));
jos_fastball_team.setM2name(rs.getString("m2name"));
jos_fastball_team.setM2phone(rs.getString("m2phone"));
jos_fastball_team.setM2mobile(rs.getString("m2mobile"));
jos_fastball_team.setM2email(rs.getString("m2email"));
jos_fastball_team.setLogo(rs.getString("logo"));
jos_fastball_team.setPhoto(rs.getString("photo"));
jos_fastball_team.setAccomplishments(rs.getString("accomplishments"));
jos_fastball_team.setChecked_out(rs.getBoolean("checked_out"));
jos_fastball_team.setChecked_out_time(rs.getTime("checked_out_time"));
jos_fastball_team.setPublished(rs.getBoolean("published"));
    }
    rs.close();
    psquery.close();
    con.close();
 return jos_fastball_team;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findById()
*/

public static List<Jos_fastball_team> findById(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where id='"+jos_fastball_team.getId()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByLeagueid()
*/

public static List<Jos_fastball_team> findByLeagueid(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where leagueid='"+jos_fastball_team.getLeagueid()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByDivisionid()
*/

public static List<Jos_fastball_team> findByDivisionid(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where divisionid='"+jos_fastball_team.getDivisionid()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByDefaultteam()
*/

public static List<Jos_fastball_team> findByDefaultteam(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where defaultteam='"+jos_fastball_team.getDefaultteam()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByName()
*/

public static List<Jos_fastball_team> findByName(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where name='"+jos_fastball_team.getName()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByShortname()
*/

public static List<Jos_fastball_team> findByShortname(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where shortname='"+jos_fastball_team.getShortname()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByCity()
*/

public static List<Jos_fastball_team> findByCity(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where city='"+jos_fastball_team.getCity()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByState()
*/

public static List<Jos_fastball_team> findByState(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where state='"+jos_fastball_team.getState()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByAdminids()
*/

public static List<Jos_fastball_team> findByAdminids(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where adminids='"+jos_fastball_team.getAdminids()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMname()
*/

public static List<Jos_fastball_team> findByMname(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where mname='"+jos_fastball_team.getMname()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMphone()
*/

public static List<Jos_fastball_team> findByMphone(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where mphone='"+jos_fastball_team.getMphone()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMmobile()
*/

public static List<Jos_fastball_team> findByMmobile(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where mmobile='"+jos_fastball_team.getMmobile()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMemail()
*/

public static List<Jos_fastball_team> findByMemail(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where memail='"+jos_fastball_team.getMemail()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMshow()
*/

public static List<Jos_fastball_team> findByMshow(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where mshow='"+jos_fastball_team.getMshow()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM1name()
*/

public static List<Jos_fastball_team> findByM1name(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m1name='"+jos_fastball_team.getM1name()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM1phone()
*/

public static List<Jos_fastball_team> findByM1phone(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m1phone='"+jos_fastball_team.getM1phone()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM1mobile()
*/

public static List<Jos_fastball_team> findByM1mobile(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m1mobile='"+jos_fastball_team.getM1mobile()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM1email()
*/

public static List<Jos_fastball_team> findByM1email(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m1email='"+jos_fastball_team.getM1email()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM1show()
*/

public static List<Jos_fastball_team> findByM1show(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m1show='"+jos_fastball_team.getM1show()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM2name()
*/

public static List<Jos_fastball_team> findByM2name(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m2name='"+jos_fastball_team.getM2name()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM2phone()
*/

public static List<Jos_fastball_team> findByM2phone(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m2phone='"+jos_fastball_team.getM2phone()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM2mobile()
*/

public static List<Jos_fastball_team> findByM2mobile(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m2mobile='"+jos_fastball_team.getM2mobile()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByM2email()
*/

public static List<Jos_fastball_team> findByM2email(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where m2email='"+jos_fastball_team.getM2email()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByLogo()
*/

public static List<Jos_fastball_team> findByLogo(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where logo='"+jos_fastball_team.getLogo()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByPhoto()
*/

public static List<Jos_fastball_team> findByPhoto(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where photo='"+jos_fastball_team.getPhoto()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByAccomplishments()
*/

public static List<Jos_fastball_team> findByAccomplishments(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where accomplishments='"+jos_fastball_team.getAccomplishments()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByChecked_out()
*/

public static List<Jos_fastball_team> findByChecked_out(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where checked_out='"+jos_fastball_team.getChecked_out()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByChecked_out_time()
*/

public static List<Jos_fastball_team> findByChecked_out_time(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where checked_out_time='"+jos_fastball_team.getChecked_out_time()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByPublished()
*/

public static List<Jos_fastball_team> findByPublished(Jos_fastball_team jos_fastball_team) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
      List<Jos_fastball_team> list = new ArrayList<>();
      String sql = "select * from jos_fastball_team where published='"+jos_fastball_team.getPublished()+"'";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_teamcon esa condicion");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* findByMapa()
*/

public static List<Jos_fastball_team> findByMapa(Map parametros) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_team> list = new ArrayList<>();
  String sql = "select * from jos_fastball_team";
  if (parametros != null) {
      Iterator it = parametros.entrySet().iterator();
      StringBuilder sb = new StringBuilder("");
      int i = 0;
      while (it.hasNext()) {
          if (i != 0){
            sb.append(" and ");
         }
         i++;
        Map.Entry e = (Map.Entry) it.next();
        sb.append(e.getKey() +"= '"+  e.getValue()+"'");
      }
      if (!sb.toString().equals("")){
         sql = sql + " where " + sb.toString();
      }
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team con esa condición");
      esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* Double Func(String funcion, String campo)
*/



public static Double Func(String funcion, String campo) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0.0;
      }
      String sql = "select "+funcion+"("+campo+") as contador from jos_fastball_team";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0.0;
   }
    Double tmp =0.0;
   rs.beforeFirst();
   while (rs.next()) {
    tmp =  rs.getDouble("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return tmp;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0.0;
}


/**
*
* Double Func(String funcion, String campo,String where)
*/



public static Double Func(String funcion, String campo, String where) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0.0;
      }
      String sql = "select "+funcion+"("+campo+") as contador from jos_fastball_team where "+where +" ";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0.0;
   }
    Double tmp =0.0;
   rs.beforeFirst();
   while (rs.next()) {
    tmp =  rs.getDouble("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return tmp;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0.0;
}


/**
*
* Contador()
*/



public static Integer Contador() {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0;
      }
      String sql = "select count(*) as contador from jos_fastball_team";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0;
   }
   rs.beforeFirst();
   while (rs.next()) {
    x =  rs.getInt("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return x;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0;
}


/**
*
* Contador(String sqlquery)
*/



public static Integer Contador(String sqlquery) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return 0;
      }
      String sql = "select count(*) as contador from jos_fastball_team where  " + sqlquery +"";
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team ");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return 0;
   }
   rs.beforeFirst();
   while (rs.next()) {
    x =  rs.getInt("contador");
    }
    rs.close();
    psquery.close();
    con.close();
 return x;
} catch (Exception ex) {
      excepcion = ex;
}
  return 0;
}


/**
*
* Query()
*/

public static List<Jos_fastball_team> Query(String query) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_team> list = new ArrayList<>();
  String sql = "select * from jos_fastball_team where " + query +"";
  if (query == null || query.equals("")) {
  return null;
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team con esa condición");
      esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
   
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
}


/**
*
* Listar()
*/

public static List<Jos_fastball_team> getLista(Map parametros) {
  excepcion = null;
  try {
      esMensaje =false;
      if (!Conectar()) {
         return null;
      }
  List<Jos_fastball_team> list = new ArrayList<>();
  String sql = "select * from jos_fastball_team";
  if (parametros != null) {
      Iterator it = parametros.entrySet().iterator();
      StringBuilder sb = new StringBuilder("");
      while (it.hasNext()) {
        Map.Entry e = (Map.Entry) it.next();
        sb.append(e.getKey() +"="+  e.getValue());
      }
      if (!sb.toString().equals("")){
         sql = sql + " where " + sb.toString();
      }
   }
  PreparedStatement psquery = con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
   ResultSet rs = psquery.executeQuery();
   rs.next();
   int x = rs.getRow();
   if (x == 0) {
      excepcion = new Exception("No existen registros en la tabla jos_fastball_team");
       esMensaje =true;
      rs.close();
      psquery.close();
      con.close();
      return null;
   }
   rs.beforeFirst();
   while (rs.next()) {
       
        Jos_fastball_team jos_fastball_team2 = new Jos_fastball_team(
         rs.getInt("id"),rs.getInt("leagueid"),rs.getInt("divisionid"),rs.getBoolean("defaultteam"),rs.getString("name"),rs.getString("shortname"),rs.getString("city"),rs.getString("state"),rs.getString("adminids"),rs.getString("mname"),rs.getString("mphone"),rs.getString("mmobile"),rs.getString("memail"),rs.getBoolean("mshow"),rs.getString("m1name"),rs.getString("m1phone"),rs.getString("m1mobile"),rs.getString("m1email"),rs.getBoolean("m1show"),rs.getString("m2name"),rs.getString("m2phone"),rs.getString("m2mobile"),rs.getString("m2email"),rs.getString("logo"),rs.getString("photo"),rs.getString("accomplishments"),rs.getBoolean("checked_out"),rs.getTime("checked_out_time"),rs.getBoolean("published"));
            
            
       list.add(jos_fastball_team2);
    }
    rs.close();
    psquery.close();
    con.close();
    return list;
} catch (Exception ex) {
      excepcion = ex;
}
  return null;
 }


/**
*
* Conectar()
*/



public static boolean Conectar() {
try {
 Sesion sesion = new Sesion();
  con = sesion.Conectar();
  if (con == null){
      return false;
   }
  return true;
  } catch (Exception ex) {
Mensajeria.MensajeError(ex, "Conectar()");
 }
    return false;
 }


}
